package top.mcwebsite.playandroid.lib.common.ext

import android.os.Build.VERSION
import android.os.Build.VERSION_CODES
import android.os.Bundle

inline fun <reified T> Bundle.getParcelableEx(key: String): T? {
    return if (VERSION.SDK_INT >= VERSION_CODES.TIRAMISU) {
        getParcelable(key, T::class.java)
    } else {
        getParcelable(key) as? T
    }
}